// 获取mongoose驱动
const mongoose = require("mongoose");
// 获取mock数据
const { shoppingCart } = require("./data/shoppingCart.js");
// 引用数据模型
require("../db/model/shoppingCart.js");


mongoose.connect(
  "mongodb://tangzhenhua:Lovo123456@182.92.214.223:8084/chenpengProject3",
  {
    useNewUrlParser: true,
    useUnifiedTopology: true,
    auth: { authSource: "admin" }
  },
  async () => {
    // 获取model
    const shoppingCartModel = mongoose.model("shoppingCart");
    await shoppingCartModel.create(shoppingCart);
  }
)